package com.ruoyi.production.service.impl.graftingclip;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.production.mapper.graftingclip.GraftingclipTypeMapper;
import com.ruoyi.production.domain.graftingclip.GraftingclipType;
import com.ruoyi.production.service.graftingclip.IGraftingclipTypeService;

/**
 * 嫁接夹类型Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-12
 */
@Service
public class GraftingclipTypeServiceImpl implements IGraftingclipTypeService
{
    @Autowired
    private GraftingclipTypeMapper graftingclipTypeMapper;

    /**
     * 查询嫁接夹类型
     *
     * @param graftingclipTypeId 嫁接夹类型ID
     * @return 嫁接夹类型
     */
    @Override
    public GraftingclipType selectGraftingclipTypeById(Long graftingclipTypeId)
    {
        return graftingclipTypeMapper.selectGraftingclipTypeById(graftingclipTypeId);
    }

    /**
     * 查询嫁接夹类型列表
     *
     * @param graftingclipType 嫁接夹类型
     * @return 嫁接夹类型
     */
    @Override
    public List<GraftingclipType> selectGraftingclipTypeList(GraftingclipType graftingclipType)
    {
        return graftingclipTypeMapper.selectGraftingclipTypeList(graftingclipType);
    }

    /**
     * 新增嫁接夹类型
     *
     * @param graftingclipType 嫁接夹类型
     * @return 结果
     */
    @Override
    public int insertGraftingclipType(GraftingclipType graftingclipType)
    {
        graftingclipType.setCreateTime(DateUtils.getNowDate());
        return graftingclipTypeMapper.insertGraftingclipType(graftingclipType);
    }

    /**
     * 修改嫁接夹类型
     *
     * @param graftingclipType 嫁接夹类型
     * @return 结果
     */
    @Override
    public int updateGraftingclipType(GraftingclipType graftingclipType)
    {
        graftingclipType.setUpdateTime(DateUtils.getNowDate());
        return graftingclipTypeMapper.updateGraftingclipType(graftingclipType);
    }

    /**
     * 批量删除嫁接夹类型
     *
     * @param graftingclipTypeIds 需要删除的嫁接夹类型ID
     * @return 结果
     */
    @Override
    public int deleteGraftingclipTypeByIds(Long[] graftingclipTypeIds)
    {
        return graftingclipTypeMapper.deleteGraftingclipTypeByIds(graftingclipTypeIds);
    }

    /**
     * 删除嫁接夹类型信息
     *
     * @param graftingclipTypeId 嫁接夹类型ID
     * @return 结果
     */
    @Override
    public int deleteGraftingclipTypeById(Long graftingclipTypeId)
    {
        return graftingclipTypeMapper.deleteGraftingclipTypeById(graftingclipTypeId);
    }
}
